package com.boot.jdk8;

import com.alibaba.fastjson.JSON;

import java.net.URL;
import java.net.URLDecoder;
import java.util.*;

public class LambdaDemo {

    public static void main(String[] args) {

        Thread t1=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("my thread1");
            }
        });
        //t1.start();
        Thread t2=new Thread(()->{System.out.println("my thread2");});
        ///t2.start();

        String[] atp = {"Rafael Nadal", "Novak Djokovic",
                "Stanislas Wawrinka", "David Ferrer",
                "Roger Federer", "Andy Murray",
                "Tomas Berdych", "Juan Martin Del Potro",
                "Richard Gasquet", "John Isner"};

        // 1.1 使用匿名内部类根据 name 排序 players
        Arrays.sort(atp, new Comparator<String>() {
            @Override
            public int compare(String s1, String s2) {
                return (s1.compareTo(s2));
            }
        });

        List<String> players =  Arrays.asList(atp);
        players.forEach(s-> System.out.println(s));
        players.forEach(System.out::println);
        //String s= (String) JSON.parse("(! 月登录天数 )\\u0026amp;(! 购买能力 )\\u0026amp; 月总PV");
        System.out.println(URLDecoder.decode("(! 月登录天数 )\u0026amp;(! 购买能力 )\u0026amp; 月总PV"));
    }
}
